<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
        <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
        <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
        <link rel="stylesheet" href="./css/estilo2.css" type="text/css" /> 
        <%@include file="cabecera.jsp" %>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Listar Seguro</title>
    </head>
    <body>
        <div class="contenedor">
            <h1>Listar Seguro</h1>

            <logic:empty name="listar">
                <p>El cliente no posee ningún seguro.</p> 
            </logic:empty>
            <logic:notEmpty name="listar" >
                <table border="1">
                    <thead>
                        <tr>
                            <th>Nombre</th>
                            <th>Importe</th>
                            <th>Meses</th>
                            <th colspan="2">Acciones</th>
                        </tr>
                    </thead>
                    <tbody>
                        <logic:iterate id="listar" name="listar">
                            <tr>
                                <td><bean:write name="listar" property="nombre" /></td>
                                <td><bean:write name="listar" property="importe" /></td>
                                <td><bean:write name="listar" property="meses" /></td>
                                <td>
                                    <html:form action="/ModificarSeguro" >
                                        <html:hidden name="listar" property="pkSeguro" />
                                        <!html:submit property="editar" value="Editar" />
                                        <html:image src="images/Edit.png" styleClass="button"  value="Editar"/>
                                    </html:form>
                        </td>
                        <td>
                            <html:form action="/EliminarSeguro" >
                                <html:hidden name="listar" property="pkSeguro" />
                                <!html:submit property="eliminar" value="Eliminar" />
                                <html:image src="images/Delete.png" styleClass="button"  value="Eliminar"/>
                            </html:form>
                        </td>
                        </tr>
                    </logic:iterate>
                </logic:notEmpty>             
                </tbody>
            </table>
            <html:link action="/AltaSeguro" >Dar de alta un seguro</html:link><br/>
            <html:link action="/VolverMenuPersonal">Volver</html:link>
        </div>
    </body>
</html>

